#!/usr/bin/env python3
# _*_coding:utf-8_*_

"""
@version: 3.5.2
@author: cockroach 
@contact: donnie.fan@gmail.com
@software: PyCharm
@file: ex_code_xmlmod_3.py
@time: 2017/2/27 12:41
"""

import xml.etree.ElementTree as ET

file_tree = ET.parse("xmltest.xml")
root = file_tree.getroot()

'''
.iter 指定所遍历的节点
'''
for xml_tree_k in root.iter("year"):
    print(xml_tree_k.tag,xml_tree_k.text)
